package com.xhapi.messageQueue;

import com.rabbitmq.client.AMQP;
import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitMQConfig {
    @Bean
    public Queue writeInEsQueue(){
        return new Queue("writeInEsQueue");
    }

    @Bean
    public Exchange writeInEsExchange(){
        return new DirectExchange("writeInEsExchange");
    }

    @Bean
    public Binding binding(Queue writeInEsQueue,DirectExchange writeInEsExchange){
        return BindingBuilder.bind(writeInEsQueue).to(writeInEsExchange).with("writeInEsKey");
    }
}
